package com.ymttest.common.enums;

/**
 * 优惠券发放类型
 */
public enum CouponSendTypeEnum {
	/**
	 * 直接发放
	 */
	Direct(1),

	/**
	 * 链接发放
	 */
	Link(2);

	private int intValue;
	private static java.util.HashMap<Integer, CouponSendTypeEnum> mappings;

	private synchronized static java.util.HashMap<Integer, CouponSendTypeEnum> getMappings() {
		if (mappings == null) {
			mappings = new java.util.HashMap<Integer, CouponSendTypeEnum>();
		}
		return mappings;
	}

	private CouponSendTypeEnum(int value) {
		intValue = value;
		CouponSendTypeEnum.getMappings().put(value, this);
	}

	public int getValue() {
		return intValue;
	}

	public static CouponSendTypeEnum forValue(int value) {
		return getMappings().get(value);
	}
}